<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>WebTileLayer - 4.6</title>

    <style>
        html,
        body,
        #viewDiv {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    </style>

    <link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css">
    <script src="https://js.arcgis.com/4.6/"></script>

    <script>
        require([
            "esri/config",
            "esri/layers/WebTileLayer",
            "esri/Map",
            "esri/views/SceneView",
            "dojo/dom",
            "dojo/domReady!"
        ], function (esriConfig, WebTileLayer, Map, SceneView, dom) {

            esriConfig.request.corsEnabledServers
                .push("a.tile.stamen.com", "b.tile.stamen.com", "c.tile.stamen.com",
                    "d.tile.stamen.com");

            var map = new Map({
                ground: "world-elevation"
            });

            var view = new SceneView({
                container: "viewDiv",
                map: map,
                scale: 123456789,
                center: [-65, -15]
            });

            var tiledLayer = new WebTileLayer({
                urlTemplate: "http://{subDomain}.tile.stamen.com/toner/{level}/{col}/{row}.png",
                subDomains: ["a", "b", "c", "d"],
                copyright: "Map tiles by <a href=\"http://stamen.com/\">Stamen Design</a>, " +
                    "under <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a>. " +
                    "Data by <a href=\"http://openstreetmap.org/\">OpenStreetMap</a>, " +
                    "under <a href=\"http://creativecommons.org/licenses/by-sa/3.0\">CC BY SA</a>."
            });

            map.add(tiledLayer);
        });
    </script>
</head>

<body>
    <div id="viewDiv"></div>
</body>

</html>